Skip to content

fix: drop gear weapons when their station furniture is gone - #29

Merged
Drefvelin merged 1 commit into
mainfrom
fix/gear-station-displays
Sep 25, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/gear-station-displays

Conversation

@Drefvelin

@Drefvelin Drefvelin commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Tag each gear-station weapon display and remember its id, so a restart removes the previous display instead of leaving another one floating.
  • When a saved station's furniture barrier is gone, on load or chunk load, drop the weapon once and delete the station record. A barrier that is still there keeps the weapon, so a lookup miss cannot throw crafts away.
  • If a magic-station break is not cancelled, drop that station's weapon. Breaks of a station that still holds a weapon stay cancelled, matched to the furniture's own block.

Existing displays that are no longer in gear-stations.yml are left for manual removal.

Test plan

  • Dev build succeeds
  • Prepare a weapon on a magic station, restart the plugin, and confirm a single display is still on the station
  • Break the station furniture out of band and confirm the weapon drops and the display is gone
  • Shift-left-click abort still refunds and does not break the furniture

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Improved protection for occupied stations and stations recently involved in an aborted session when nearby furniture is broken.
    • Station state is now checked as chunks load, helping remove stale displays and recover weapons when station furniture is missing.
    • Displays associated with stations are cleaned up when the server shuts down.

Station displays were persistent and easy to leave floating after the furniture broke or a restart missed an unloaded chunk. Tag each display, keep a single one per saved station, and drop the weapon when the station block is no longer there.

Co-authored-by: Cursor <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c602cc00-ea8e-4806-8368-012e996b29fa

📥 Commits

Reviewing files that changed from the base of the PR and between b9f4d64 and 8058f8d.

📒 Files selected for processing (3)
  • src/main/java/net/tfminecraft/magic/gear/GearKeys.java
  • src/main/java/net/tfminecraft/magic/gear/GearStationListener.java
  • src/main/java/net/tfminecraft/magic/gear/GearStationStore.java
 ___________________________________________________
< Brace yourself. Winter is coming...for your bugs. >
 ---------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@Drefvelin
Drefvelin merged commit f1e5d8f into main Sep 25, 2026
1 of 2 checks passed
@Drefvelin
Drefvelin deleted the fix/gear-station-displays branch September 25, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant